package com.beiding.workordersystem.common.config;

import com.beiding.workordersystem.common.helper.IdCreator;
import com.beiding.workordersystem.common.utils.ApplicationUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

@Configuration
public class CommonConfig {

    public CommonConfig(ApplicationContext context) {
        ApplicationUtils.init(context);
    }

    @Bean
    public IdCreator idCreator() {
        return () -> UUID.randomUUID().toString();
    }

}
